import { combineReducers, createStore } from 'redux'
import userInfo from "./userInfo/index";
import common from "./common/index";


const reducer = combineReducers({
  userInfo,
  common
})

const store = createStore(reducer)

export default store

// import { commonNum, commonMessage } from "./common/action";

//监听器，每次调用dispatch执行 返回注销监听器的方法
// const unsubscribe = store.subscribe(() => console.log(store.getState()))

// store.dispatch(commonNum(10))
// store.dispatch(commonMessage({
//   num: 10,
//   type: "number",
//   name: "age"
// }))

//注销监听器
// unsubscribe()
// console.log(store.getState())